package mediator 
{
	import core.Mediator;
	import event.LessonEvent;
	import event.MenuEvent;
	import event.PlayerEvent;
	import flash.events.MouseEvent;
	import view.MenuView;
	
	/**
	 * ...
	 * @author liwei
	 */
	public class MenuMediator extends Mediator 
	{
		[Inject]
		[view]
		public var _view:MenuView;
		public function MenuMediator() 
		{
			super();
			
		}
		override protected function viewInit():void 
		{
			_view.exitmc.addEventListener(MouseEvent.CLICK, exitmc_click);
			_view.addEventListener(MenuEvent.START, view_start);
		}
		
		private function view_start(e:MenuEvent):void 
		{
			dispatchEvent(new LessonEvent(LessonEvent.CHANGE, e.chapter, e.lesson));
		}
		
		private function exitmc_click(e:MouseEvent):void 
		{
			dispatchEvent(new PlayerEvent(PlayerEvent.HIDE_MENU));
		}
	}

}